package Prototype;

import java.util.List;

/**
 * Title: User <br>
 * Description: 原型模式案例<br>
 * Copyright (c) 传化物流版权所有 2017 <br>
 * Created DateTime: 2017-3-7 13:47
 * Created by Wentao.Shi.
 */
public class User implements Cloneable{
    private String name;
    private int id;
    private List<Book> book;


    public User() {
    }

    public User(String name, int id) {
        this.name = name;
        this.id = id;
    }
    public User(String name, int id,List list) {
        this.name = name;
        this.id = id;
        this.book=list;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Book> getBook() {
        return book;
    }

    public void setBook(List<Book> book) {
        this.book = book;
    }

    public User clone(){
        User user=null;
        try {
            user= (User) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return user;
    }
}
